<?php

/**
 * This is the model class for table "setting".
 *
 * The followings are the available columns in table 'setting':
 * @property integer $id
 * @property integer $post_per_ip
 * @property integer $post_interval
 * @property integer $upper_age
 * @property integer $lower_age
 * @property integer $login_cl
 * @property integer $use_location
 * @property integer $random_subarea
 * @property integer $use_age
 * @property integer $use_fw_email
 * @property integer $max_wait_time
 * @property integer $log_auto_scroll
 * @property string $post_type
 * @property integer $auto_post
 * @property integer $change_ip
 * @property string $user_name
 * @property string $password
 * @property integer $country_id
 * @property integer $use_proxy
 * @property string $postfix
 * @property string $prefix
 * @property string $vpn_name
 * @property string $max_try
 * @property string $user_id
 * @property string $ie_path
 * @property string $ff_path
 * @property string $driver
 * @property string $accountid
 * @property string $vpn
 * @property string $web_email
 * @property string $close_browser
 * @property string $random
 * @property string $delete_post
 * @property string $update_account
 * @property string $proxy_type
 * @property string $use_proxy
 * @property string $use_slot
 * @property string $post_insame_session
 * @property string $renew
 * @property string $hide_resources
 * @property string $slot_no
 * @property string $job
 * @property string $run_individual
 * @property string $domain_info
 * @property string $email_read_try
 */
class Setting extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return Setting the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'setting';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('post_per_ip, post_interval, upper_age, lower_age, login_cl, use_location, random_subarea, use_age, use_fw_email, max_wait_time, log_auto_scroll, auto_post, change_ip, country_id, use_proxy, max_try,user_id', 'numerical', 'integerOnly'=>true),
			array('ie_path, ff_path, gc_path, post_type, user_name, password, postfix, prefix,vpn_name', 'length', 'max'=>255),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, post_per_ip, post_interval, upper_age, lower_age, login_cl, use_location, random_subarea, use_age, use_fw_email, max_wait_time, log_auto_scroll, post_type, auto_post, change_ip, user_name, password, country_id, use_proxy, postfix, prefix', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'post_per_ip' => 'Post Per Ip',
			'post_interval' => 'Post Interval',
			'upper_age' => 'Upper Age',
			'lower_age' => 'Lower Age',
			'login_cl' => 'Login Cl',
			'use_location' => 'Use Location',
			'random_subarea' => 'Random Subarea',
			'use_age' => 'Use Age',
			'use_fw_email' => 'Use Fw Email',
			'max_wait_time' => 'Max Wait Time',
			'log_auto_scroll' => 'Log Auto Scroll',
			'post_type' => 'Post Type',
			'auto_post' => 'Auto Post',
			'change_ip' => 'Change Ip',
			'user_name' => 'User Name',
			'password' => 'Password',
			'country_id' => 'Country',
			'use_proxy' => 'Use Proxy',
			'postfix' => 'Postfix',
			'prefix' => 'Prefix',
			'user_id' => 'User ID',
                        'ie_path' => 'IE Path',
                        'ff_path' => 'FF Path',
                        'gc_path' => 'GC Path',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('post_per_ip',$this->post_per_ip);
		$criteria->compare('post_interval',$this->post_interval);
		$criteria->compare('upper_age',$this->upper_age);
		$criteria->compare('lower_age',$this->lower_age);
		$criteria->compare('login_cl',$this->login_cl);
		$criteria->compare('use_location',$this->use_location);
		$criteria->compare('random_subarea',$this->random_subarea);
		$criteria->compare('use_age',$this->use_age);
		$criteria->compare('use_fw_email',$this->use_fw_email);
		$criteria->compare('max_wait_time',$this->max_wait_time);
		$criteria->compare('log_auto_scroll',$this->log_auto_scroll);
		$criteria->compare('post_type',$this->post_type,true);
		$criteria->compare('auto_post',$this->auto_post);
		$criteria->compare('change_ip',$this->change_ip);
		$criteria->compare('user_name',$this->user_name,true);
		$criteria->compare('password',$this->password,true);
		$criteria->compare('country_id',$this->country_id);
		$criteria->compare('use_proxy',$this->use_proxy);
		$criteria->compare('postfix',$this->postfix,true);
		$criteria->compare('prefix',$this->prefix,true);
		$criteria->compare('user_id',$this->user_id,true);
                $criteria->compare('ie_path',$this->ie_path,true);
                $criteria->compare('ff_path',$this->ff_path,true);
                $criteria->compare('gc_path',$this->gc_path,true);
		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}